package org.example.cascader.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.example.cascader.domain.BaseZyjbqk;

import java.util.List;

@Mapper
public interface BaseZyjbqkMapper extends BaseMapper<BaseZyjbqk> {
    // 查询所有不同的授予学位门类
    @Select("SELECT DISTINCT syxwml as syxwml, '' as code, '' as name, '' as zymc FROM base_zyjbqk WHERE syxwml IS NOT NULL AND year='2023'")
    List<BaseZyjbqk> selectDistinctSyxwml();

    // 查询所有不同的专业门类
    @Select("SELECT DISTINCT zymc as zymc, '' as code, '' as name, syxwml FROM base_zyjbqk WHERE zymc IS NOT NULL AND year='2023'")
    List<BaseZyjbqk> selectDistinctZymc();

    // 根据授予学位门类查询
    @Select("SELECT * FROM base_zyjbqk WHERE syxwml = #{syxwml} AND year='2023'")
    List<BaseZyjbqk> selectBySyxwml(@Param("syxwml") String syxwml);

    // 根据专业门类查询
    @Select("SELECT * FROM base_zyjbqk WHERE zymc = #{zymc} AND year='2023'")
    List<BaseZyjbqk> selectByZymc(@Param("zymc") String zymc);
}